import { createContext } from 'react';

export type ComponentFocusProps = {
  onFocus: VoidFunction;
  onBlur: VoidFunction;
  canFocusOther?: boolean;
  canBeAutoFocused?: boolean;
};

export const AutoFocusContext = createContext<{
  register: (
    id: number | null | undefined,
    props: ComponentFocusProps,
  ) => number;
  unregister: (id: number) => void;
  focusNext: (selfID: number) => void;
}>({
  register: () => -1,
  unregister: () => {},
  focusNext: () => {},
});
